package com.atguigu.servlet;

import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import java.io.IOException;
import java.io.PrintWriter;
@WebServlet("/s1")
public class UserServlet extends HttpServlet {
    @Override
    public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException {
        String username = request.getParameter("username");
        String info="YES";
        if("atguigu".equals(username)) {
            info="NO";
        }
        PrintWriter writer = response.getWriter();
        writer.write(info);
    }
}
